<div class="main clearfix">
    <div class="Tabs clearfix">
        <ul class="clearfix">
            <li><a href="<?php echo Url::createUrl("paymentTotal/index")?>"><span>Tổng</span></a></li>
            <li><a class="active" href="<?php echo Url::createUrl("paymentSmsWapmaster/index")?>"><span>SMS</span></a></li>
            <li><a href="<?php echo Url::createUrl("paymentCardWapmaster/index")?>"><span>CARD</span></a></li>
            <li><a href="<?php echo Url::createUrl("paymentChargingWapmaster/index")?>"><span>CHARGING</span></a></li>
        </ul>                
    </div>
    
    <div class="box_tab bottom30 clearfix">
        <div class="Tabs clearfix">
            <ul class="clearfix">
                <li><a href="<?php echo Url::createUrl("paymentSmsWapmaster/index")?>"><span>Tài khoản Wapmaster</span></a></li>
                <li><a class="active" href="<?php echo Url::createUrl("paymentSmsPartner/index")?>"><span>Nhà phân phối</span></a></li>
                <li><a href="<?php echo Url::createUrl("paymentSmsProduct/index")?>"><span>Sản phẩm</span></a></li>            
            </ul>                
        </div>
        <div class="box clearfix">
            <form action="" method="GET">
                <ul class="form4">
                    <input type="hidden" name="partnerId" value="<?php echo $search["partnerId"];?>">
                    <li class="clearfix">
                        <label><strong>Từ ngày </strong>:</label>
                        <div class="filltext">
                            <?php
                                $this->widget(
                                    "zii.widgets.jui.CJuiDatePicker"
                                    , array(
                                        "name"=>"toDate"
                                        , "id"=>"toDate"
                                        , "value"=>$search["toDate"]                                                                
                                        , "options"=> array(
                                            'showAnim' => 'fold'
                                            , 'dateFormat' => 'dd-mm-yy'
                                            , 'changeYear' => 'true'
                                            , 'changeMonth' => 'true'
                                            , 'showOn' => 'both'
                                            , 'buttonText' => '<input type="button" name="" value="" class="ic-date">'
                                        )
                                        , 'htmlOptions' => array(
                                            'style' => 'width:170px'
                                            , 'class' => 'form'
                                        )
                                    )
                                );
                            ?>                                       
                            &nbsp;đến ngày &nbsp; 
                            <?php
                                $this->widget(
                                    "zii.widgets.jui.CJuiDatePicker"
                                    , array(
                                        "name"=>"fromDate"
                                        , "id"=>"fromDate"
                                        , "value"=>$search["fromDate"]                                                                
                                        , "options"=> array(
                                            'showAnim' => 'fold'
                                            , 'dateFormat' => 'dd-mm-yy'
                                            , 'changeYear' => 'true'
                                            , 'changeMonth' => 'true'
                                            , 'showOn' => 'both'
                                            , 'buttonText' => '<input type="button" name="" value="" class="ic-date">'
                                        )
                                        , 'htmlOptions' => array(
                                            'style' => 'width:170px'
                                            , 'class' => 'form'
                                        )
                                    )
                                );
                            ?>
                        </div>
                    </li>
                    <li class="clearfix">
                        <label><strong>Từ khóa </strong>:</label>
                        <div class="filltext">
                            <input type="text" name="keyword" style="width:331px;margin-right:28px" value="<?php echo $search["keyword"];?>">
                            <select style="width:150px;" name="type">                            
                                <option value="1" <?php if($search["type"]=="1") echo "selected";?> >Nhà phân phối</option>                            
                                <option value="2" <?php if($search["type"]=="2") echo "selected";?> >Tên Game</option>                            
                                <option value="3" <?php if($search["type"]=="3") echo "selected";?> >Tên Video</option> 
                                <option value="4" <?php if($search["type"]=="4") echo "selected";?> >Tên Image</option> 
                                <option value="5" <?php if($search["type"]=="5") echo "selected";?> >Tên Nhạc chờ</option> 
                                <option value="6" <?php if($search["type"]=="6") echo "selected";?> >Xổ số</option> 
                                <option value="7" <?php if($search["type"]=="7") echo "selected";?> >SMS kute</option> 
                                <option value="8" <?php if($search["type"]=="8") echo "selected";?> >Test</option> 
                                <option value="9" <?php if($search["type"]=="9") echo "selected";?> >Mod Game</option> 
                            </select>
                        </div>
                    </li>
                    <li class="clearfix">
                        <label><strong>Nhà mạng(Telco) </strong>:</label>
                        <div class="filltext">
                            <select style="width:150px;" name="telco">
                                <option value=""> Tất cả </option>                            
                                <option value="1" <?php if($search["telco"]=="1") echo "selected";?> >Viettel</option>                            
                                <option value="2" <?php if($search["telco"]=="2") echo "selected";?> >Mobifone</option>                            
                                <option value="3" <?php if($search["telco"]=="3") echo "selected";?> >Vinaphone</option>                            
                                <option value="4" <?php if($search["telco"]=="4") echo "selected";?> >Vietnammobile</option>                            
                                <option value="5" <?php if($search["telco"]=="5") echo "selected";?> >Beeline</option>                            
                            </select>
                            <select style="width:150px;" name="serviceNumber">
                                <option value=""> Tất cả </option>
                                <?php foreach($serviceNumber as $row){ ?>
                                <option value="<?php echo $row["serviceNumber"];?>" <?php if($search["serviceNumber"]==$row["serviceNumber"]) echo "selected";?> ><?php echo $row["serviceNumber"];?></option>
                                <?php }?>
                            </select>    
                            <select style="width:150px;" name="price">
                                <option value=""> Tất cả </option>
                                <option value="5000" <?php if($search["price"]=="5000") echo "selected";?> >5.000</option>
                                <option value="10000" <?php if($search["price"]=="10000") echo "selected";?> >10.000</option>
                                <option value="15000" <?php if($search["price"]=="15000") echo "selected";?> >15.000</option>
                            </select>                    
                        </div>
                    </li>
                    <li class="clearfix"><label>&nbsp;</label>
                        <div class="filltext">
                            <input type="submit" value=" Tìm kiếm" class="btn-bigblue"> 
                        </div>
                    </li>

                </ul>
            </form>
        </div>
    </div>
    <div class="box">
        <div class="fillter clearfix">
            <div class="fl">Tìm thấy <strong class="clred"><?php echo $totalSms;?></strong> kết quả trong <strong class="clred"><?php echo $numberPage;?></strong> trang</div>
            <?php                
                $url = new Url();            
                $current_url = Common::getCurrentUrl();
                $path = strpos($current_url,'?') !==false ? $current_url.'&' : $current_url.'?';
                $path = str_replace("?page=".$currentPage."&","?",$path);
                $path = str_replace("&page=".$currentPage."&","&",$path);
            ?>            
            <div class="fr">
                <a href="#" class="excel"><strong>Xuất ra file excel</strong></a>
                <ul class="paging">
                    <?php echo Paging::show_paging_cp($numberPage, $currentPage, $path);?>
                </ul>
            </div>
        </div>
        <div class="table clearfix">
            <div class="table clearfix">
                <table width="100%" cellspacing="0" cellpadding="0" border="0">
                    <tbody>
                        <tr class="bg-grey">
                            <td width="4%"><strong>STT</strong></td>
                            <td width="8%"><strong>Thời gian gửi</strong></td>                            
                            <td width="10%"><strong>Loại sản phẩm</strong></td>
                            <td width="10%"><strong>Sản phẩm</strong></td>
                            <td width="7%"><strong>SĐT</strong></td>
                            <td width="21%"><strong>Cú pháp</strong></td>
                            <td width="5%"><strong>Đầu số</strong></td>
                            <td width="5%"><strong>Giá</strong></td>
                            <td width="6%"><strong>DT sau Telco</strong></td>
                            <td width="6%"><strong>DT sau đầu số</strong></td>
                            <td width="6%"><strong>DT Thành viên</strong></td>
                            <td width="6%"><strong>DT mtop</strong></td>
                            <td width="6%"><strong>DT NSX</strong></td>
                        </tr>
                        <?php foreach($sms as $i=>$row) { ?>
                        <tr>
                            <td><?php echo $i + 1;?></td>
                            <td><?php echo date("H:i:s d-m-Y", $row["create_date"]);?></td>                            
                            <td><?php echo $row["content_type"];?></td>
                            <td><?php echo $row["title"];?></td>                            
                            <td><?php echo $row["mobile"];?></td>                                                        
                            <td><?php echo $row["content"];?></td>                                                                                    
                            <td><?php echo $row["serviceNumber"];?></td>                                                                                    
                            <td class="text-right clred"><?php echo Common::format_price($row["price"]);?></td>
                            <td class="text-right clred"><?php echo Common::format_price(round($row["telco"]));?></td>
                            <td class="text-right clred"><?php echo Common::format_price(round($row["sc"]));?></td>
                            <td class="text-right clred"><?php echo Common::format_price(round($row["wapmaster"]));?></td>
                            <td class="text-right clred"><?php echo Common::format_price(round($row["mtop"]));?></td>
                            <td class="text-right clred"><?php echo Common::format_price(round($row["partner"]));?></td>
                        </tr>
                        <?php }?>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="fillter clearfix">
            <div class="fr">
                <ul class="paging">
                    <?php echo Paging::show_paging_cp($numberPage, $currentPage, $path);?>
                </ul>
            </div>
        </div>

    </div>
</div>